import React ,{ Component } from "react";
import PhotoUploadModal from "../../components/PhotoUploadModal"
import { getRandomKey } from "../../utils/utils";
import { map } from "lodash-es";

export default class Dashbord extends Component {
    constructor(props){
        super(props);
        this.state = {
            randomKey:getRandomKey(),
        }
        this.fileds= [];
    }

    render(){


        return <div>
            <PhotoUploadModal
            onBeforeUploadCb={(f)=>{
                console.log("f>>>>",f);
                this.fileds.push(f);
                this.setState({randomKey:getRandomKey(),})
            }}
            
            />  
            {
                map(this.fileds,item=>(
                    <img src={item.thumbUrl}/>
                ))
            }  
        </div>
    }
}